home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / Auto_Drawi201896992006.psc / Auto Drawing / Form1.frm next >
Text File  |  2006-09-09  |  4KB  |  128 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "AUTO DRAWING"
  5.    ClientHeight    =   6000
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   5685
  9.    Icon            =   "Form1.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   6000
  14.    ScaleWidth      =   5685
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.PictureBox Picture2 
  17.       Appearance      =   0  'Flat
  18.       AutoSize        =   -1  'True
  19.       BackColor       =   &H80000005&
  20.       ForeColor       =   &H80000008&
  21.       Height          =   540
  22.       Left            =   0
  23.       Picture         =   "Form1.frx":000C
  24.       ScaleHeight     =   510
  25.       ScaleWidth      =   3855
  26.       TabIndex        =   2
  27.       Top             =   5445
  28.       Width           =   3885
  29.       Begin VB.Label lblSelectedColour 
  30.          BackColor       =   &H0000FFFF&
  31.          Height          =   420
  32.          Left            =   45
  33.          TabIndex        =   3
  34.          Top             =   45
  35.          Width           =   405
  36.       End
  37.    End
  38.    Begin VB.Timer Timer1 
  39.       Enabled         =   0   'False
  40.       Interval        =   1
  41.       Left            =   2415
  42.       Top             =   6015
  43.    End
  44.    Begin VB.CommandButton cmdStart 
  45.       Caption         =   "&START"
  46.       BeginProperty Font 
  47.          Name            =   "Verdana"
  48.          Size            =   8.25
  49.          Charset         =   0
  50.          Weight          =   700
  51.          Underline       =   0   'False
  52.          Italic          =   0   'False
  53.          Strikethrough   =   0   'False
  54.       EndProperty
  55.       Height          =   420
  56.       Left            =   3960
  57.       TabIndex        =   1
  58.       Top             =   5505
  59.       Width           =   1215
  60.    End
  61.    Begin VB.PictureBox Picture1 
  62.       AutoSize        =   -1  'True
  63.       BackColor       =   &H00C00000&
  64.       BorderStyle     =   0  'None
  65.       FillColor       =   &H00C00000&
  66.       Height          =   5430
  67.       Left            =   15
  68.       ScaleHeight     =   5430
  69.       ScaleWidth      =   5700
  70.       TabIndex        =   0
  71.       Top             =   -15
  72.       Width           =   5700
  73.       Begin VB.Label lblAxis 
  74.          AutoSize        =   -1  'True
  75.          BackStyle       =   0  'Transparent
  76.          ForeColor       =   &H00FFFFFF&
  77.          Height          =   195
  78.          Left            =   4380
  79.          TabIndex        =   4
  80.          Top             =   105
  81.          Width           =   45
  82.       End
  83.    End
  84. End
  85. Attribute VB_Name = "Form1"
  86. Attribute VB_GlobalNameSpace = False
  87. Attribute VB_Creatable = False
  88. Attribute VB_PredeclaredId = True
  89. Attribute VB_Exposed = False
  90. Private FSO As FileSystemObject
  91. Private TS As TextStream
  92. Private StrPoints As String, strX As String, strY As String
  93. Private dblSelectedColour As Double
  94. Private Sub cmdStart_Click()
  95.     Timer1.Enabled = True
  96. End Sub
  97.  
  98. Private Sub Form_Load()
  99.     Set FSO = New FileSystemObject
  100.     Set TS = FSO.OpenTextFile(App.Path & "\Points.pan", ForReading)
  101.     Picture1.DrawWidth = 2
  102.     dblSelectedColour = vbYellow
  103. End Sub
  104. Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  105.     lblSelectedColour.BackColor = Picture2.Point(X, Y)
  106.     dblSelectedColour = lblSelectedColour.BackColor
  107. End Sub
  108. Private Sub Timer1_Timer()
  109.     On Error GoTo Finish
  110.     StrPoints = TS.ReadLine
  111.     strX = Mid(StrPoints, 1, InStr(1, StrPoints, ":") - 1)
  112.     strY = Mid(StrPoints, InStr(1, StrPoints, ":") + 1)
  113.     lblAxis.Caption = "X=" & strX & " : Y=" & strY
  114.     Picture1.PSet (strX, strY), dblSelectedColour
  115. Finish:
  116. If Err.Number = 62 Then
  117.     If MsgBox("Do You Want To Continue ?", vbQuestion + vbYesNo, "Confirmation") = vbYes Then
  118.         Set TS = FSO.OpenTextFile(App.Path & "\Points.pan", ForReading)
  119.         Picture1.Cls
  120.     Else
  121.         MsgBox "Please...Post Your Vote", vbInformation, "Bye"
  122.         Timer1.Enabled = False
  123.         End
  124.         Exit Sub
  125.     End If
  126. End If
  127. End Sub
  128.